package com.platform.config;

import com.aspose.cad.internal.R.I;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;

import java.util.Arrays;
import java.util.List;

/**
 * xling specific properties
 */
@ConfigurationProperties(prefix = "xling", ignoreUnknownFields = false)
@PropertySources({
        @PropertySource(value = "classpath:git.properties", ignoreResourceNotFound = true),
        @PropertySource(value = "classpath:META-INF/build-info.properties", ignoreResourceNotFound = true)
})
@Data
public class XlingProperties {

    /**
     * 文档存储配置
     */
    private final Doc doc = new Doc();

    /**
     * swagger 配置
     */
    private final Swagger swagger = new Swagger();


    private final Message message = new Message();


    @Data
    public static class Doc {

        private String mode = XlingDefaults.Doc.mode;
        private Minio minio = new Minio();
        private Local local = new Local();
        private Mongo mongo = new Mongo();

        @Data
        public static class Minio{
            private String endPoint;// = XlingDefaults.Doc.Minio.endPoint;
            private String accessKey;// = XlingDefaults.Doc.Minio.accessKey;
            private String secretKey;// = XlingDefaults.Doc.Minio.secretKey;
            private String defaultBucket;// = XlingDefaults.Doc.Minio.defaultBucket;
            private String mc;// = XlingDefaults.Doc.Minio.mc;
        }
        @Data
        public static class Local{
            private String root = XlingDefaults.Doc.Local.root;
        }

        @Data
        public static class Mongo{

        }






    }

    @Data
    public static class Swagger {

        private String title = XlingDefaults.Swagger.title;

        private String description = XlingDefaults.Swagger.description;

        private String version = XlingDefaults.Swagger.version;

        private String termsOfServiceUrl = XlingDefaults.Swagger.termsOfServiceUrl;

        private String contactName = XlingDefaults.Swagger.contactName;

        private String contactUrl = XlingDefaults.Swagger.contactUrl;

        private String contactEmail = XlingDefaults.Swagger.contactEmail;

        private String license = XlingDefaults.Swagger.license;

        private String licenseUrl = XlingDefaults.Swagger.licenseUrl;

        private String defaultIncludePattern = XlingDefaults.Swagger.defaultIncludePattern;

        private String host = XlingDefaults.Swagger.host;

        private String[] protocols = XlingDefaults.Swagger.protocols;

        private boolean useDefaultResponseMessages = XlingDefaults.Swagger.useDefaultResponseMessages;

    }


    @Data
    public static class Message {

        private  List<JPush> jpushs = Arrays.asList();

        @Data
        public static class JPush {

            private String masterSecret;

            private String appKey;

            private Integer timeToLive;

            private Integer maxRetryTimes;

            private boolean apnsProduction;

            private String clientId;

        }

    }



}
